using IQIGame.Onigao.GamePlay;
using NetProtocol.Enum;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 战斗结束触发
    /// </summary>
    public class TrigEndBattle : BaseServiceTrigger
    {
        public override bool OnTrigger(LevelPlayer player, object dynamicParam, TrigValueTypeParam dynamicValueTypePram)
        {
            var config = _paramConfig as TrigParamEndBattle;
            bool isWin = dynamicValueTypePram.param1 == (int)BattleResultType.Success;
            //0是己方，1是敌方
            if (isWin == (config.successTeam == 0))
            {
                return base.OnTrigger(player, dynamicParam, dynamicValueTypePram);
            }
            return false;
        }
    }
}
